package com.baizhi.service.impl;

import com.baizhi.dao.RoleDAO;
import com.baizhi.entity.Role;
import com.baizhi.service.RoleService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDAO roleDAO;
    @Override
    public PageInfo<Role> selectAll(Integer page, Integer limit) {
        PageHelper.startPage(page,limit);
        List<Role> list = roleDAO.selectAll();
        PageInfo<Role> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
